package com.erplan.swt.app.gx;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class TestCode {

	public static void executeTestCode(Display display, Shell shell){
		CTabFolder tabFolder = new CTabFolder(shell, SWT.CLOSE);
		tabFolder.setSimple(false);
		//tabFolder.setUnselectedCloseVisible(false);
		tabFolder.setSelectionBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE),
				display.getSystemColor(SWT.COLOR_BLUE),
				display.getSystemColor(SWT.COLOR_WHITE),
				display.getSystemColor(SWT.COLOR_WHITE)},
				new int[] {25, 50, 100});
		tabFolder.setBackground(display.getSystemColor(SWT.COLOR_BLUE));
		for (int i=0; i<6; i++) {
			CTabItem item = new CTabItem (tabFolder, SWT.NONE);
			item.setText ("TabItem " + i);
			item.setImage(new Image(display, Gx.class.getResourceAsStream("images/icon.gif")));
			Button button = new Button(tabFolder, SWT.PUSH);
			button.setText ("Page " + i);
			item.setControl (button);
		}
		//tabFolder.pack ();

	}
}
